Skip to content

Conversation

@Gupta-02
Copy link
Contributor

Description

This PR implements integration with popular accounting platforms QuickBooks and Xero, addressing issue #176. Users can now connect their ExpenseFlow accounts to external accounting software for seamless expense synchronization.

Changes Made

Backend Implementation
New Model: AccountingConnection.js - Stores OAuth tokens and connection details for each user-platform pair
New Service: accountingService.js - Handles OAuth flows, token refresh, and expense synchronization logic
New Routes: accounting.js - RESTful API endpoints for authentication and sync operations
Model Update: Added syncedToAccounting field to Expense.js to track synchronization status
Server Configuration: Added accounting routes to Express app in server.js
Dependencies: Added intuit-oauth and xero-node packages to package.json

API Endpoints Added

GET /api/accounting/auth/:platform - Initiates OAuth flow for QuickBooks/Xero
GET /api/accounting/callback/:platform - Handles OAuth callback and token storage
GET /api/accounting/connections - Retrieves user's connected accounting platforms
POST /api/accounting/sync/:platform - Synchronizes unsynced expenses to accounting platform
DELETE /api/accounting/disconnect/:platform - Removes accounting platform connection
Features Implemented
OAuth 2.0 Integration: Secure authentication with QuickBooks and Xero APIs
Token Management: Automatic token refresh handling
Expense Synchronization: One-way sync from ExpenseFlow to accounting platforms
Platform Support: QuickBooks Online and Xero
Error Handling: Comprehensive error handling for API failures
Security: Proper token storage and user isolation
Environment Variables Required

Testing

Syntax validation passed for all new files
OAuth flow logic implemented with proper error handling
Expense mapping to accounting platform formats included
Token refresh mechanisms in place
Future Enhancements
Two-way synchronization (import from accounting platforms)
Support for additional accounting platforms (Sage, FreshBooks, etc.)
Bulk sync operations
Webhook integration for real-time updates
Frontend UI components for connection management
Breaking Changes
None - this is a new feature with no impact on existing functionality.

Checklist

Code follows project conventions
Error handling implemented
Security considerations addressed
Documentation updated (API endpoints)
Environment variables documented
No breaking changes introduced
Closes #176

@vercel
Copy link

vercel bot commented Jan 24, 2026

@Gupta-02 is attempting to deploy a commit to the Renu's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link

🎉 Thanks for the PR, @Gupta-02!

We really appreciate you taking the time to contribute to OpenPlayground! 💙


⭐ Love this project?

Please give us a star! It helps the project grow and reach more developers! 🌟

🔗 https://github.com/Renu-code123/ExpenseFlow


✅ PR Checklist

Before we review, please ensure:

  • Your code follows the project's coding standards
  • All file changes are accurate and intentional
  • You've tested your changes locally
  • Any review comments have been addressed

🙌 Thank You for Contributing!

We truly appreciate your interest in contributing to this project.

  • Please make sure your code follows the project structure
  • Add clear commit messages and comments where necessary
  • Ensure your changes do not break existing functionality

We'll review your PR as soon as possible. Keep up the great work! ✨


@Gupta-02
Copy link
Contributor Author

Add env

QUICKBOOKS_CLIENT_ID=your_quickbooks_client_id
QUICKBOOKS_CLIENT_SECRET=your_quickbooks_client_secret
QUICKBOOKS_REDIRECT_URI=your_redirect_uri
XERO_CLIENT_ID=your_xero_client_id
XERO_CLIENT_SECRET=your_xero_client_secret
XERO_REDIRECT_URI=your_redirect_uri
To get working integration

@Renu-code123
Copy link
Owner

@Gupta-02 resolve conflict

@Gupta-02
Copy link
Contributor Author

@Renu-code123 done!

@vercel
Copy link

vercel bot commented Jan 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
expenseflow Ready Ready Preview, Comment Jan 24, 2026 4:19pm

@Renu-code123
Copy link
Owner

@Gupta-02 it's still showing conflict

@Gupta-02
Copy link
Contributor Author

Resolved @Renu-code123

@Renu-code123 Renu-code123 added the enhancement New feature or request label Jan 24, 2026
@Renu-code123 Renu-code123 merged commit 29ff129 into Renu-code123:main Jan 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration with External Accounting Software

2 participants